package com.perye.dokit.service.impl;

import com.perye.dokit.mapper.dao.DaoSupport;
import com.perye.dokit.service.WeCompInfoService;
import com.perye.dokit.utils.pageData.PageData;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import javax.annotation.Resource;
import java.util.List;

@Service
public class WeCompInfoServiceImpl implements WeCompInfoService{

    @Resource
    private DaoSupport daoSupport;



    @Override
    public List<PageData> getall() throws Exception {
        List<PageData> pageData= (List<PageData>) daoSupport.findNotPage("WeComInfomapper.getall");
        return pageData;
    }

    @Override
    public Integer addinfo(PageData pageData) throws Exception {
        Integer result= (Integer) daoSupport.save("WeComInfomapper.addinfo",pageData);
        return result;
    }

    @Override
    public PageData selInfoId(PageData pageData) throws Exception {
       PageData pageData1= (PageData) daoSupport.findForObject("WeComInfomapper.selInfoId",pageData);

        return pageData1;
    }

    @Override
    public Integer updinfo(PageData pageData) throws Exception {
        Integer result= (Integer) daoSupport.update("WeComInfomapper.updinfo",pageData);
        return result;
    }

    @Override
    public Integer delinfo(PageData pageData) throws Exception {
        Integer result= (Integer) daoSupport.delete("WeComInfomapper.delinfo",pageData);
     return    result;
    }

    @Override
    public PageData selInfoName(PageData pageData) throws Exception {
        PageData pageData1= (PageData) daoSupport.findForObject("WeComInfomapper.selInfoName",pageData);
        return pageData1;
    }


    @Override
    public void addimg(PageData pageData) throws Exception {
      daoSupport.save("WeComInfomapper.addimg",pageData);
    }


    @Override
    public Integer updimg(PageData pageData) throws Exception {
        Integer page=(Integer) daoSupport.update("WeComInfomapper.updimg",pageData);
        return page;
    }


    @Override
    public Integer delimg(PageData pageData) throws Exception {
        Integer result= (Integer) daoSupport.delete("WeComInfomapper.delimg",pageData);
        return result;
    }
}
